<?php
/**
 * SolicitationsApiTest
 * PHP version 8.3
 *
 * @category Class
 * @package  SpApi
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * Selling Partner API for Solicitations
 *
 * With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient's Message Center. The Solicitations API returns responses that are formed according to the <a href=https://tools.ietf.org/html/draft-kelly-json-hal-08>JSON Hypertext Application Language</a> (HAL) standard.
 *
 * The version of the OpenAPI document: v1
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.9.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Please update the test case below to test the endpoint.
 */

namespace SpApi\Test\Api;

use SpApi\ApiException;
use SpApi\Api\solicitations\v1\SolicitationsApi;
use SpApi\ObjectSerializer;

/**
 * SolicitationsApiTest Class Doc Comment
 *
 * @category Class
 * @package  SpApi
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */
class SolicitationsApiTest extends BaseTestCase
{
    private SolicitationsApi $apiInstance;
    public function setUp(): void
    {
        parent::setUp();
        // Initialize parameter value specific to case
        $this->testHelper->setSpecificValue('SolicitationsApi', $this->getName());
        $this->apiInstance = new SolicitationsApi($this->config, null);
        // Change Time Format if it requires
        $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('SolicitationsApi');
        if ($specificTimeFormat) {
            ObjectSerializer::setDateTimeFormat($specificTimeFormat);
        }
    }

    /**
     * Test case for createProductReviewAndSellerFeedbackSolicitation_201
     */
    public function testCreateProductReviewAndSellerFeedbackSolicitation201()
    {
        try {
            // Skip test if it is in the skip list
            if ($this->testHelper->shouldSkipTest('testCreateProductReviewAndSellerFeedbackSolicitation201', 'SolicitationsApi')) {
                $this->assertTrue(true);
                return;
            }
            $jsonSchema = '{
  &quot;description&quot; : &quot;The message was created for the order.&quot;,
  &quot;headers&quot; : {
    &quot;x-amzn-RequestId&quot; : {
      &quot;description&quot; : &quot;Unique request reference identifier.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    },
    &quot;x-amzn-RateLimit-Limit&quot; : {
      &quot;description&quot; : &quot;Your rate limit (requests per second) for this operation.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    }
  },
  &quot;content&quot; : {
    &quot;application/hal+json&quot; : {
      &quot;schema&quot; : {
        &quot;$ref&quot; : &quot;#/components/schemas/CreateProductReviewAndSellerFeedbackSolicitationResponse&quot;
      }
    }
  },
  &quot;x-amzn-api-sandbox&quot; : {
    &quot;static&quot; : [ {
      &quot;request&quot; : {
        &quot;parameters&quot; : {
          &quot;amazonOrderId&quot; : {
            &quot;value&quot; : &quot;123-1234567-1234567&quot;
          }
        }
      },
      &quot;response&quot; : { }
    } ]
  }
}';
            $result = $this->testHelper->extractRequestAndResponse(
                $this->apiInstance,
                $jsonSchema,
                'createProductReviewAndSellerFeedbackSolicitation'
            );
            $requestParams = $result['requestParams'];
            $expectedResponse = $result['expectedResponse'];

            // Change Time Format if it requires
            $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('SolicitationsApi');
            if ($specificTimeFormat) {
                ObjectSerializer::setDateTimeFormat($specificTimeFormat);
            }

            // Act: Call API
            list($response, $statusCode, $headers) =
                $this->apiInstance->createProductReviewAndSellerFeedbackSolicitationWithHttpInfo(...array_values($requestParams));

            // Assert the response code
            $this->assertHttpStatusCode(201, $statusCode);

            // Handle different response codes
            $this->handleResponse($response, $statusCode, 201, $expectedResponse);
        } catch (ApiException $e) {
            $this->handleApiException($e, 201);
        } catch (\ReflectionException $e) {
            $this->fail("Reflection exception: " . $e->getMessage());
        }
    }
    /**
     * Test case for createProductReviewAndSellerFeedbackSolicitation_400
     */
    public function testCreateProductReviewAndSellerFeedbackSolicitation400()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for createProductReviewAndSellerFeedbackSolicitation_403
     */
    public function testCreateProductReviewAndSellerFeedbackSolicitation403()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for createProductReviewAndSellerFeedbackSolicitation_404
     */
    public function testCreateProductReviewAndSellerFeedbackSolicitation404()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for createProductReviewAndSellerFeedbackSolicitation_413
     */
    public function testCreateProductReviewAndSellerFeedbackSolicitation413()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for createProductReviewAndSellerFeedbackSolicitation_415
     */
    public function testCreateProductReviewAndSellerFeedbackSolicitation415()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for createProductReviewAndSellerFeedbackSolicitation_429
     */
    public function testCreateProductReviewAndSellerFeedbackSolicitation429()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for createProductReviewAndSellerFeedbackSolicitation_500
     */
    public function testCreateProductReviewAndSellerFeedbackSolicitation500()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for createProductReviewAndSellerFeedbackSolicitation_503
     */
    public function testCreateProductReviewAndSellerFeedbackSolicitation503()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for getSolicitationActionsForOrder_200
     */
    public function testGetSolicitationActionsForOrder200()
    {
        try {
            // Skip test if it is in the skip list
            if ($this->testHelper->shouldSkipTest('testGetSolicitationActionsForOrder200', 'SolicitationsApi')) {
                $this->assertTrue(true);
                return;
            }
            $jsonSchema = '{
  &quot;description&quot; : &quot;Returns hypermedia links under the _links.actions key that specify which solicitation actions are allowed for the order.&quot;,
  &quot;headers&quot; : {
    &quot;x-amzn-RequestId&quot; : {
      &quot;description&quot; : &quot;Unique request reference identifier.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    },
    &quot;x-amzn-RateLimit-Limit&quot; : {
      &quot;description&quot; : &quot;Your rate limit (requests per second) for this operation.&quot;,
      &quot;schema&quot; : {
        &quot;type&quot; : &quot;string&quot;
      }
    }
  },
  &quot;content&quot; : {
    &quot;application/hal+json&quot; : {
      &quot;schema&quot; : {
        &quot;$ref&quot; : &quot;#/components/schemas/GetSolicitationActionsForOrderResponse&quot;
      },
      &quot;example&quot; : {
        &quot;_links&quot; : {
          &quot;actions&quot; : [ {
            &quot;href&quot; : &quot;/solicitations/v1/orders/903-1671087-0812628/solicitations/productReviewAndSellerFeedback?marketplaceIds&#x3D;ATVPDKIKX0DER&quot;,
            &quot;name&quot; : &quot;productReviewAndSellerFeedback&quot;
          } ],
          &quot;self&quot; : {
            &quot;href&quot; : &quot;/solicitations/v1/orders/903-1671087-0812628?marketplaceIds&#x3D;ATVPDKIKX0DER&quot;
          }
        },
        &quot;_embedded&quot; : {
          &quot;actions&quot; : [ {
            &quot;_links&quot; : {
              &quot;schema&quot; : {
                &quot;href&quot; : &quot;/solicitations/v1/orders/903-1671087-0812628/solicitations/productReviewAndSellerFeedback/schema&quot;,
                &quot;name&quot; : &quot;productReviewAndSellerFeedback&quot;
              }
            }
          } ]
        }
      }
    }
  },
  &quot;x-amzn-api-sandbox&quot; : {
    &quot;static&quot; : [ {
      &quot;request&quot; : {
        &quot;parameters&quot; : {
          &quot;amazonOrderId&quot; : {
            &quot;value&quot; : &quot;123-1234567-1234567&quot;
          },
          &quot;marketplaceIds&quot; : {
            &quot;value&quot; : [ &quot;ATVPDKIKX0DER&quot; ]
          }
        }
      },
      &quot;response&quot; : {
        &quot;_links&quot; : {
          &quot;actions&quot; : [ {
            &quot;href&quot; : &quot;/solicitations/v1/orders/123-1234567-1234567/solicitations/productReviewAndSellerFeedback?marketplaceIds&#x3D;ATVPDKIKX0DER&quot;,
            &quot;name&quot; : &quot;productReviewAndSellerFeedback&quot;
          } ],
          &quot;self&quot; : {
            &quot;href&quot; : &quot;/solicitations/v1/orders/123-1234567-1234567?marketplaceIds&#x3D;ATVPDKIKX0DER&quot;
          }
        }
      }
    } ]
  }
}';
            $result = $this->testHelper->extractRequestAndResponse(
                $this->apiInstance,
                $jsonSchema,
                'getSolicitationActionsForOrder'
            );
            $requestParams = $result['requestParams'];
            $expectedResponse = $result['expectedResponse'];

            // Change Time Format if it requires
            $specificTimeFormat = $this->testHelper->getDateTimeFormatForCase('SolicitationsApi');
            if ($specificTimeFormat) {
                ObjectSerializer::setDateTimeFormat($specificTimeFormat);
            }

            // Act: Call API
            list($response, $statusCode, $headers) =
                $this->apiInstance->getSolicitationActionsForOrderWithHttpInfo(...array_values($requestParams));

            // Assert the response code
            $this->assertHttpStatusCode(200, $statusCode);

            // Handle different response codes
            $this->handleResponse($response, $statusCode, 200, $expectedResponse);
        } catch (ApiException $e) {
            $this->handleApiException($e, 200);
        } catch (\ReflectionException $e) {
            $this->fail("Reflection exception: " . $e->getMessage());
        }
    }
    /**
     * Test case for getSolicitationActionsForOrder_400
     */
    public function testGetSolicitationActionsForOrder400()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for getSolicitationActionsForOrder_403
     */
    public function testGetSolicitationActionsForOrder403()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for getSolicitationActionsForOrder_404
     */
    public function testGetSolicitationActionsForOrder404()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for getSolicitationActionsForOrder_413
     */
    public function testGetSolicitationActionsForOrder413()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for getSolicitationActionsForOrder_415
     */
    public function testGetSolicitationActionsForOrder415()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for getSolicitationActionsForOrder_429
     */
    public function testGetSolicitationActionsForOrder429()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for getSolicitationActionsForOrder_500
     */
    public function testGetSolicitationActionsForOrder500()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
    /**
     * Test case for getSolicitationActionsForOrder_503
     */
    public function testGetSolicitationActionsForOrder503()
    {
        // Skip this test
        $this->markTestSkipped('Skip test for this operation.');
    }
}
